3.45 \(\int \frac {3+x^2}{-3+x^2} \, dx\)

Optimal. Leaf size=17 \[ x-2 \sqrt {3} \tanh ^{-1}\left (\frac {x}{\sqrt {3}}\right ) \]

[Out]

x-2*arctanh(1/3*x*3^(1/2))*3^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {388, 207} \[ x-2 \sqrt {3} \tanh ^{-1}\left (\frac {x}{\sqrt {3}}\right ) \]

Antiderivative was successfully verified.

[In]

Int[(3 + x^2)/(-3 + x^2),x]

[Out]

x - 2*Sqrt[3]*ArcTanh[x/Sqrt[3]]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rubi steps

\begin {align*} \int \frac {3+x^2}{-3+x^2} \, dx &=x+6 \int \frac {1}{-3+x^2} \, dx\\ &=x-2 \sqrt {3} \tanh ^{-1}\left (\frac {x}{\sqrt {3}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 33, normalized size = 1.94 \[ x+\sqrt {3} \log \left (\sqrt {3}-x\right )-\sqrt {3} \log \left (x+\sqrt {3}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(3 + x^2)/(-3 + x^2),x]

[Out]

x + Sqrt[3]*Log[Sqrt[3] - x] - Sqrt[3]*Log[Sqrt[3] + x]

________________________________________________________________________________________

fricas [A]  time = 0.62, size = 26, normalized size = 1.53 \[ \sqrt {3} \log \left (\frac {x^{2} - 2 \, \sqrt {3} x + 3}{x^{2} - 3}\right ) + x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+3)/(x^2-3),x, algorithm="fricas")

[Out]

sqrt(3)*log((x^2 - 2*sqrt(3)*x + 3)/(x^2 - 3)) + x

________________________________________________________________________________________

giac [B]  time = 0.41, size = 30, normalized size = 1.76 \[ \sqrt {3} \log \left (\frac {{\left | 2 \, x - 2 \, \sqrt {3} \right |}}{{\left | 2 \, x + 2 \, \sqrt {3} \right |}}\right ) + x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+3)/(x^2-3),x, algorithm="giac")

[Out]

sqrt(3)*log(abs(2*x - 2*sqrt(3))/abs(2*x + 2*sqrt(3))) + x

________________________________________________________________________________________

maple [A]  time = 0.00, size = 15, normalized size = 0.88 \[ x -2 \sqrt {3}\, \arctanh \left (\frac {\sqrt {3}\, x}{3}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2+3)/(x^2-3),x)

[Out]

x-2*arctanh(1/3*x*3^(1/2))*3^(1/2)

________________________________________________________________________________________

maxima [A]  time = 2.88, size = 22, normalized size = 1.29 \[ \sqrt {3} \log \left (\frac {x - \sqrt {3}}{x + \sqrt {3}}\right ) + x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x^2+3)/(x^2-3),x, algorithm="maxima")

[Out]

sqrt(3)*log((x - sqrt(3))/(x + sqrt(3))) + x

________________________________________________________________________________________

mupad [B]  time = 0.92, size = 14, normalized size = 0.82 \[ x-2\,\sqrt {3}\,\mathrm {atanh}\left (\frac {\sqrt {3}\,x}{3}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2 + 3)/(x^2 - 3),x)

[Out]

x - 2*3^(1/2)*atanh((3^(1/2)*x)/3)

________________________________________________________________________________________

sympy [A]  time = 0.19, size = 27, normalized size = 1.59 \[ x + \sqrt {3} \log {\left (x - \sqrt {3} \right )} - \sqrt {3} \log {\left (x + \sqrt {3} \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2+3)/(x**2-3),x)

[Out]

x + sqrt(3)*log(x - sqrt(3)) - sqrt(3)*log(x + sqrt(3))

________________________________________________________________________________________